package com.bigshark.api.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bigshark.api.form.CVForm;
import com.bigshark.api.mapper.ConventionsMapper;
import com.bigshark.api.model.Conventions;
import com.bigshark.api.service.ConventionsService;
import com.bigshark.common.utills.PageUtils;
import org.springframework.stereotype.Service;


@Service("conventionsService")
public class ConventionsServiceImpl extends ServiceImpl<ConventionsMapper,Conventions> implements ConventionsService {
    @Override
    public PageUtils selectList(CVForm cvForm) {
        Page<Conventions> page = new Page<>(cvForm.getPage(),cvForm.getSize());
        QueryWrapper<Conventions> wrapper = new QueryWrapper<>();
        wrapper.orderByDesc("id");
        IPage<Conventions> data = baseMapper.selectPage(page,wrapper);
        return new PageUtils(data);
    }
}
